<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-model结合checkbox类型</title>
</head>
<body>
<div id="app">
  <!--1、checkbox单选框-->
  <label for="agree">
    <input type="checkbox" id="agree" v-model="isAgree">同意以上协议
  </label>
  <h2>您的选择是：{{isAgree}}</h2>
  <button :disabled="!isAgree">下一步</button>

  <hr>

  <!--2、checkbox复选框-->
  爱好：
  <input type="checkbox" name="hobbits" value="篮球" v-model="hobbits">篮球
  <input type="checkbox" name="hobbits" value="足球" v-model="hobbits">足球
  <input type="checkbox" name="hobbits" value="羽毛球" v-model="hobbits">羽毛球
  <input type="checkbox" name="hobbits" value="乒乓球" v-model="hobbits">乒乓球
  <h2>您的爱好是：{{hobbits}}</h2>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      isAgree: false,
      hobbits: []
    },
  });
</script>
</body>
</html>
